package com.lesson00;

import java.awt.*;

public class TestFlowLayout {
    public static void main(String[] args) {
        Frame frame = new Frame("测试FlowLayout");

        Button button1 = new Button("Button1");
        Button button2 = new Button("Button2");
        Button button3 = new Button("Button3");

        //frame.setLayout(new FlowLayout(FlowLayout.LEFT)); // 设置FlowLayout布局，居左对齐
        frame.setLayout(new FlowLayout(FlowLayout.CENTER));// 设置FlowLayout布局，居中对齐
        frame.setSize(200, 200);
        frame.add(button1);
        frame.add(button2);
        frame.add(button3);

        frame.setVisible(true);
    }
}
